import { baseUrl } from "./request";

export const apiUpload = (data: string) => {
    console.log(data);
    
    return new Promise((resolve, reject) => {
        uni.uploadFile({
            url: baseUrl + 'upload', //仅为示例，非真实的接口地址
            filePath: data,
            name: 'file',
            success: (uploadFileRes) => {
                console.log(uploadFileRes);
                const result = JSON.parse(uploadFileRes.data)
                resolve(result);
            },
            complete: (file) => {
                console.log(file);
            }
        });
    })
    // return request('upload', 'POST', {})
}